package com.ppch.zerocodegenerator.service;

import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.service.IService;
import com.ppch.zerocodegenerator.model.dto.user.UserLoginRequest;
import com.ppch.zerocodegenerator.model.dto.user.UserModifyPassWord;
import com.ppch.zerocodegenerator.model.dto.user.UserQueryRequest;
import com.ppch.zerocodegenerator.model.dto.user.UserRegisterRequest;
import com.ppch.zerocodegenerator.model.entity.User;
import com.ppch.zerocodegenerator.model.vo.LoginUserVO;
import com.ppch.zerocodegenerator.model.vo.UserVO;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 用户 服务层。
 *
 * @author 泡泡茶壶
 * @since 2025-10-5
 */
public interface UserService extends IService<User> {


    long userRegister(UserRegisterRequest userRegisterRequest);

    LoginUserVO userLogin(UserLoginRequest userLoginRequest, HttpServletRequest request);

    User getLoginUser(HttpServletRequest request);

    String getRandomAvatar();

    boolean userLogout(HttpServletRequest request);

    LoginUserVO getLoginUserVO(User user);

    UserVO getUserVO(User user);

    List<UserVO> getUserVOList(List<User> userList);

    QueryWrapper getUserQueryWrapper(UserQueryRequest userQueryRequest);

    boolean isAdmin(User user);

    boolean changePassword(UserModifyPassWord userModifyPassWord, HttpServletRequest request);

    boolean resetPassword(User loginUser, String newPassword, String checkPassword);

    String updateUserAvatar(MultipartFile multipartFile, Long id, HttpServletRequest request);

    String getEncryptPassword(String default_password);
}
